home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
ansi
/
vtest.zip
/
VTEST.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1989-11-16
|
9KB
|
277 lines
Program video_performance_test;
{ $ DEFINE TEST} { if defined, faster tests performed }
(*
┌───────────────────────────────────────────────────────────────────────────┐
│ VTEST.PAS │
├───────────────────────────────────────────────────────────────────────────┤
│ Version : 1.0 │
│ Computer : IBM-PC or compatible │
│ Lenguage : Turbo Pascal 5.5 │
│ Authors : Bernardo Zamora │
├──────────────────┬────────────────────────────────────────────────────────┤
│ Explanation : │ │
├──────────────────┘ │
│ This program performs BIOS subfunctions 00-0Fh several times to │
│ measure their speed. Used to time the video-speed_up programs. │
│ │
├─────────┬───────────────────────────────────────────────────────┬─────────┤
│ Date │ Modifications │ By ... │
├─────────┼───────────────────────────────────────────────────────┼─────────┤
│15-Nov-89│Program made and all 00-10fh functions added. V1.0 │Bernardo │
│16-Nov-89│Include switches -F,-T,-S,-E. Modify test for routine │Same guy!│
│ │14h (Teletype) not to scroll screen. │ │
│ │ │ │
│ │ │ │
└───────────────────────────────────────────────────────────────────────────┘
*)
uses
timing,
dos,
crt;
const
MINTEST = 0;
MAXTEST = 15;
VideoText : array [0..15] of string = (
('0 - Set Video Mode '),
('1 - Set Cursor Size '),
('2 - Set Cusor Position '),
('3 - Read Cursor Position '),
('4 - Read LightPen Position '),
('5 - Set active Display Page '),
('6 - Scroll Window Up '),
('7 - Scroll Window Down '),
('8 - Read Character and Attribute '),
('9 - Write Character and Attribute '),
('A - Write Character '),
('B - Set Color Palette '),
('C - Write Pixel '),
('D - Read Pixel '),
('E - Write Character in teletype mode '),
('F - Get Current Video Mode ')
);
{$IFDEF TEST}
T : array [MINTEST..MAXTEST] of integer =
(40,800,1000,1200,
800,500,400,400,
1200,700,900,700,
500,500,5,700);
{$ELSE}
T : array [MINTEST..MAXTEST] of integer =
(400,8000,10000,12000,
8000,5000,4000,4000,
12000,7000,9000,7000,
5000,5000,50,7000);
{$ENDIF}
var
f : text; { output file }
i : byte;
rr : registers;
min,max : integer; { minimum and maximum numbered tests.. }
ss,
name : string; { name of output file }
Procedure Test(number:byte);
var
i,j : integer;
begin
with rr do
case number of
{ Set video mode }
0 : for i:=1 to T[0] do begin
ah := 0; al := 3;
intr(16,rr);
end;
{ Set cursor size }
1 : for i:=1 to T[1] do
for j:=1 to 10 do begin
ah := 1; ch := j; cl := j-1;
intr(16,rr);
end;
{ Set cursor position }
2 : for i:=1 to T[2] do
for j:=1 to 10 do begin
ah := 2; bh := 0; dh := j; dl := j;
intr(16,rr);
end;
{ Read Cursor Position }
3 : for i:=1 to T[3] do
for j:=1 to 10 do begin
ah := 3; bh := 0;
intr(16,rr);
end;
{ Read Light Pen position }
4 : for i:=1 to T[4] do
for j:=1 to 10 do begin
ah := 4;
intr(16,rr);
end;
{ Set Active Display Page }
5 : for i:=1 to T[5] do
for j:=1 to 10 do begin
ah := 5; al := 0;
intr(16,rr);
end;
{ Scroll Up }
6 : for i:=1 to T[6] do begin
ah := 6; al := 12; bh := 7; ch := 10; cl := 10; dh := 24; dl := 78;
intr(16,rr);
end;
{ Scroll Down }
7 : for i:=1 to T[7] do begin
ah := 7; al := 12; bh := 7; ch := 10; cl := 10; dh := 24; dl := 78;
intr(16,rr);
end;
{ Read Character And Attribute }
8 : for i:=1 to T[8] do
for j:=1 to 10 do begin
ah := 8; bh := 0;
intr(16,rr);
end;
{ Write Character And Attribute }
9 : for i:=1 to T[9] do
for j:=1 to 10 do begin
ah := 9; al := j+47; bh := 0; bl := j; cx := 1;
intr(16,rr);
end;
{ Write Character }
10: for i:=1 to T[10] do
for j:=1 to 10 do begin
ah := 10; al := j+47; bh := 0; cx := 1;
intr(16,rr);
end;
{ Set Color Palette }
11: for i:=1 to T[11] do
for j:=1 to 10 do begin
ah := 11; bh := 0; bl := 0;
intr(16,rr);
end;
{ Write Pixel }
12: begin
ah := 0; al := 6; { 640x200 graphics mode } intr(16,rr);
for i:=1 to T[12] do
for j:=1 to 10 do begin
ah := 12; al := 1; bh := 0; cx := i; dx := j;
intr(16,rr);
end;
ah := 0; al := 3; { 80x25 text mode } intr(16,rr);
end;
{ Read Pixel }
13: begin
ah := 0; al := 6; { 640x200 graphics mode } intr(16,rr);
for i:=1 to T[13] do
for j:=1 to 10 do begin
ah := 13; bh := 0; cx := i; dx := j;
intr(16,rr);
end;
ah := 0; al := 3; { 80x25 text mode } intr(16,rr);
end;
{ Write Character in teletype mode }
14: for i:=1 to T[14] do begin
ah := 2; bh := 0; dx := 0; dl := 0; intr(16,rr); { set cursor }
for j:=1 to 1999 do begin
ah := 14; al := 30 + i mod 200; bh := 0; intr(16,rr);
end;
end;
{ Get video mode }
15: for i:=1 to T[15] do
for j:=1 to 10 do begin
ah := 15; intr(16,rr);
end;
end; { case number of }
end;
Function value (s:string):byte;
begin
s[3] := Upcase(s[3]);
case s[3] of
'0'..'9' : value := ord(s[3])-ord('0');
'A'..'F' : value := ord(s[3])-ord('A')+10;
else begin
Writeln('Test number erroneous [',s[3],']');
Halt(2);
end;
end;
end;
Procedure Help;
begin
Writeln('Sintax : VTEST { [-|/]fname [-|/]t# [-|/]s# [-|/]e# }');
Writeln(' -fname = results written to "name" file');
Writeln(' -t# = Do test # only');
Writeln(' -s# = Start testing in test #');
Writeln(' -e# = End testing in test #');
Writeln;
Writeln('Note : # is any char in [0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f]');
Halt(0);
end;
begin
DirectVideo := false;
Writeln;
Writeln('Video performance test V1.0 -- Bernardo Zamora Etcharren');
name := 'results.dat';
min := MINTEST;
max := MAXTEST;
for i:=1 to ParamCount do begin
ss := ParamStr(i);
if ss[1] in ['/','-'] then begin
case Upcase(ss[2]) of
'F' : name := Copy(ss,3,Length(ss)-2);
'T' : begin min := value(ss); max := value(ss); end;
'S' : min := value(ss);
'E' : max := value(ss);
'?','H' : help;
else begin
Writeln('Unrecognized option [',ss[2],'], test aborted.');
halt(1);
end;
end { case }
end { if ss[1] i